package com.antler.smt.admin.controller;

import com.antler.smt.admin.annotation.OperateCut;
import com.antler.smt.request.base.BasePageReq;
import com.antler.smt.utils.LogUtil;
import com.antler.smt.request.admin.GetProposalListReq;
import com.antler.smt.response.admin.GetProposalListResp;
import com.antler.smt.response.base.Result;
import com.antler.smt.service.admin.ProposalService;
import com.antler.smt.validate.DataValidator;
import com.github.pagehelper.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 后台意见与反馈控制接口
 *
 * @author zhangyi
 * @date 2018/3/21 12:58
 */
@RestController
@RequestMapping(value = "/proposalBack")
@Api(description = "后台意见与反馈控制接口")
public class ProposalController {
  /**
   * 日志
   */
  private static Logger log = LogUtil.get();

  @Resource
  private ProposalService proposalService;

  /**
   * 获取意见与反馈列表
   *
   * @param request 请求实体
   * @return Result实体
   */
  @GetMapping("/listProposal")
  @ApiOperation(value = "获取意见与反馈列表", httpMethod = "GET")
  @OperateCut(content = "获意见与反馈列表")
  public Result<Page<GetProposalListResp>> listProposal(BasePageReq request) {

    DataValidator.isNull(request,"意见建议反馈列表的分页参数不能为空！");

    Result result = null;
      result = proposalService.listProposal(request);
    return result;
  }

}
